package com.jic.manager.api.rest;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.manager.request.MestorePageRequest;
import com.jic.manager.request.MestoreRequest;
import com.jic.manager.request.SysDeptRequest;
import com.jic.manager.response.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 *
 * @date: 2020-01-09
 * @remark: 商品后台管理系统的服务接口
 *
 * feignClient  使用方法:
 *
 * 1.服务提供者编写 FeignClient 属性 name对应注册中心服务Id path为统一前缀  url可以直接指定调用地址（调试用）
 * 2.客户端需要在启动类上加上@EnableFeignClients注解
 * 3.如果通过feignClient调用超时，请设置
 * ribbon:
 *   ReadTimeout: 3000
 *   ConnectTimeout: 3000
 * 4.客户端依赖该jic-feign-common,在调用处@Resource注解注入 即可调用
 */
@FeignClient(name = "jic-manager",path = "/api/store")
public interface ManagerStoreApi {
    @PostMapping("/getStoreInfo")
    RestResult<MemStoreResponse> getStoreInfo(Long  storeId);

    @PostMapping("getShopList")
    RestResult<List<MemMerchantInfoResponse>> getShopList(@RequestParam(value = "merchantIds")  List<Long> merchantIds);

    @PostMapping("queryByPrimaryKey")
    Mestore queryByPrimaryKey(@RequestParam("id") Long id);

    @PostMapping("/getStoreInfoList")
    List<MemStoreResponse> getStoreInfoList(MestoreRequest request);

    @PostMapping("/checkDeptByStoreIds")
    RestResult<List<StoreOfDept>> checkDeptByStoreIds(MestorePageRequest request);

    @PostMapping("/queryPage")
    PageResult<MestoreResponse> queryPage(MestoreRequest mestore);

    /*通过商家或店铺deptId 查询所属子平台deptId*/
    @PostMapping("/getDeptIdByMsId")
    Long getDeptIdByMsId(SysDeptRequest sysDept);

    @PostMapping("getMerchantList")
     List<MemMerchantInfoResponse> getMerchantList(@RequestParam(value = "deptIds")  List<Long> deptIds);

}
